package com.igeek.controller;


import com.igeek.model.claims.InsuranceFlowable;
import com.igeek.result.Result;
import com.igeek.service.IInsuranceFlowableService;
import com.igeek.vo.process.ProcessDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2024-08-19
 */
@RestController
@RequestMapping("/insurance-flowable")
@Slf4j
public class InsuranceFlowableController {
    @Autowired
    private IInsuranceFlowableService insuranceFlowableService;


    @GetMapping("/getAll")
    public Result getAll(){
        List<InsuranceFlowable> list = insuranceFlowableService.list();
        return Result.ok(list);
    }

    @PostMapping("/add")
    public Result addTemplate(@RequestBody ProcessDto processDto){
        insuranceFlowableService.addTemplate(processDto);
        return Result.ok();
    }

    @GetMapping("getPerson/{id}")
    public Result getPerson(@PathVariable Integer id){
        String[] person = insuranceFlowableService.getPerson(id);
        log.info("---------------"+Arrays.toString(person));
        return Result.ok(person);
    }




}
